package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Arrays;


public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("person.obj");

        ObjectInputStream ois = new ObjectInputStream(fis);

        Person p = (Person)ois.readObject();

        System.out.println(p.getName());

        System.out.println(p.getAge());
        System.out.println(p.getGender());
        System.out.println(p);
        System.out.println(Arrays.toString(p.getOtherInfo()));
        ois.close();

    }
}
